﻿<Window x:Class="JobOffersBrowser.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Job Board Browser" Height="600" Width="1000">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="878*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="20"/>
            <RowDefinition Height="250"/>
            <RowDefinition Height="450"/>
        </Grid.RowDefinitions>
        
        <Menu >
            <MenuItem Header="Menu">
                <MenuItem Header="AdvancedSearch" Click="MenuAdvancedSearchItem_Click"/>
                <MenuItem Header="Statistics" Click="StatisticsMenu_Click"/> 
                <MenuItem Header="Exit" Click="ExitMenu_Click"/>
            </MenuItem>
        </Menu>
        
        <ListView Grid.RowSpan="2" Grid.Row="1" Grid.Column="0"
                  x:Name="ListViewIndustries" ItemsSource="{Binding Industries}" DisplayMemberPath="IndustryName"
                  SelectedItem="{Binding CurrentIndustry}">
            
        </ListView>

        <DataGrid x:Name="DataGridOffers" Grid.Column="1" Grid.Row="1" ItemsSource="{Binding Offers}" AutoGenerateColumns="False" CanUserAddRows="False"
                  SelectedItem="{Binding CurrentOffer}" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="ID" Binding="{Binding OfferID}"/>
                <DataGridTextColumn Header="JobTitle" Binding="{Binding JobTitle}"/>
                <DataGridTextColumn Header="Status" Binding="{Binding Status}"/>
                <DataGridTextColumn Header="PublishDate" Binding="{Binding PublishDate}"/>
                <DataGridTextColumn Header="DaysRemaining" Binding="{Binding ValidDaysRemaining}"/>
                <DataGridTextColumn Header="Industry" Binding="{Binding Industry.IndustryName}"/>
                <DataGridTextColumn Header="Company" Binding="{Binding Company.Name}"/>
                <DataGridTextColumn Header="Country" Binding="{Binding Country}"/>
                <DataGridTextColumn Header="City" Binding="{Binding City}"/>
                <DataGridTextColumn Header="Description" Binding="{Binding JobDescription}"/>              
            </DataGrid.Columns>
        </DataGrid>

        <Grid Grid.Row="2" Grid.Column="1" DataContext="{Binding CurrentOffer}">
            <StackPanel Orientation="Horizontal" Width="500" HorizontalAlignment="Left">
                <StackPanel Width="250" HorizontalAlignment="Left">
                    <TextBlock Text="JobDetails" FontWeight="Bold"></TextBlock>
                    <TextBlock></TextBlock>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="ID: "/>
                        <TextBlock Text="{Binding OfferID}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Type: "/>
                        <TextBlock Text="{Binding JobTitle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Status: "/>
                        <TextBlock Text="{Binding Status}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="PublishDate: "/>
                        <TextBlock Text="{Binding PublishDate}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="DaysRemaining: "/>
                        <TextBlock Text="{Binding ValidDaysRemaining}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Industry: "/>
                        <TextBlock Text="{Binding Industry.IndustryName}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Company: "/>
                        <TextBlock Text="{Binding Company.Name}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Country: "/>
                        <TextBlock Text="{Binding Country}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="City: "/>
                        <TextBlock Text="{Binding City}"/>
                    </StackPanel>
                    <TextBlock Text="Description:"/>
                    <TextBlock Text="{Binding JobDescription}"/>
                </StackPanel>
                <StackPanel Width="250">
                    <TextBlock Text="JobDetails" FontWeight="Bold"></TextBlock>
                    <TextBlock></TextBlock>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="ID: "/>
                        <TextBlock Text="{Binding Company.ID}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="CompanyName: "/>
                        <TextBlock Text="{Binding Company.Name}"/>
                        <Image Source="{Binding Company.Logo}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Description: "/>
                        <TextBlock Text="{Binding Company.Description}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="WebSite: "/>

                        <TextBlock>
                            <Hyperlink NavigateUri="{Binding Company.WebSite}" Click="Hyperlink_Click">
                                Open WebSite
                            </Hyperlink>
                        </TextBlock>

                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Email: "/>
                        <TextBlock>
                            <Hyperlink NavigateUri="{Binding Company.Email}" Click="Hyperlink_Click">
                                Send mail
                            </Hyperlink>
                        </TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Phone: "/>
                        <TextBlock Text="{Binding Company.Phone}"/>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
            
        </Grid>
    </Grid>
</Window>
